<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
</head>
<body>
	<center>
		<table>
			<tr>
				<td>用户名：</td>
				<td><input type="text" name="names" id="names"></td>
			</tr>
			<tr>
				<td>密码：</td>
				<td><input type="password" name="pwd" id="pwd"></td>
			</tr>
			<tr>
				<td>手机号：</td>
				<td><input type="text" name="tel" id="tel"></td>
				<td><input type="button" value="发送验证码" id="send"></td>
			</tr>
			<tr>
				<td>验证码：</td>
				<td><input type="text" name="code" id="code"></td>
			</tr>
			<tr>
				<td><input type="button" value="注册" id="zhuce"></td>
				<td></td>
			</tr>
		</table>
	</center>
</body>
</html>
<script src="http://apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js"></script>
<script>
	$("#send").click(function(){
		var tel = $("#tel").val();
		// alert(tel);
		if (tel == ''){
			alert("请输入手机号");
			return false;
		};
		$.ajax({
			url:"SendTemplateSMS.php",
			data:{tel:tel},
			type:"post",
			dataType:"json",
			success:function(res){
				
			}
		})
	})
	$("#zhuce").click(function(){
		var names = $("#names").val();
		var pwd = $("#pwd").val();
		var tel = $("#tel").val();
		var code = $("#code").val();
		$.ajax({
			url:"zhuce.php",
			data:{names:names,pwd:pwd,tel:tel,code:code},
			type:"post",
			dataType:"json",
			success:function(res)
			{
				alert(res.msg);
				location.href="show.php";
			}
		})
	})

</script>